package partlycloudy;

class Cloud
{
    private Daylight daylight = new Daylight();
    private Luminary luminary = new Luminary();
    private Wind wind = new Wind();

    private Creature InternalCreate() 
    {
      if (daylight.Current == DaylightType.Night)
      {
        if (luminary.IsShining())
        {
            if (wind.Current == 10)
            {
                 return new Creature(CreatureType.Bat);
            }
        }        
      }
   
       
      if (daylight.Current == DaylightType.Morning)
      {
        if (luminary.IsShining())
        {
            if (wind.Current == 0)
            {
                 return new Creature(CreatureType.Puppy);
            }
            
            if ((wind.Current >= 5)&&(wind.Current <= 9))
            {
                 return new Creature(CreatureType.Balloon);
            }
        }
        else
        {
            if ((wind.Current >= 1)&&(wind.Current <= 4))
            {
                 return new Creature(CreatureType.Bearcub);
            }
        }
      }
      
      if (daylight.Current == DaylightType.Noon)
      {
        if (!luminary.IsShining())       
        {
            if ((wind.Current >= 1)&&(wind.Current <= 4))
            {
                 return new Creature(CreatureType.Kitten);
            }
            if ((wind.Current >= 5)&&(wind.Current <= 9))
            {
                 return new Creature(CreatureType.Piglet);
            }
        }
      }
            
      if (daylight.Current == DaylightType.Evening)
      {
        if ((wind.Current == 10))
        {
           return new Creature(CreatureType.Hedgehog);
        }
        
      }
         return new Creature(CreatureType.Bat);//   throw new java.lang.UnsupportedOperationException();// new NotImplementedException();
      
    }

    public Creature Create()
    {
      Creature creature = InternalCreate();
      Magic magic = new Magic();
      if ((creature.CreatureType == CreatureType.Piglet) || (creature.CreatureType == CreatureType.Bat))
      {
            creature.Delivery = magic.CallDemon(creature.CreatureType);
      }
      else
      {
         creature.Delivery = magic.CallStork(creature.CreatureType);
      }
      return creature;
    }
}

enum DeliveryType {Stork, Demon}
enum DaylightType {Night, Morning, Noon, Evening}
enum CreatureType {Puppy, Kitten, Hedgehog, Bearcub, Piglet, Bat, Balloon}

class Daylight
{
    public DaylightType Current;
}

class Luminary
{
    public boolean Shine;
    
    public boolean IsShining()
    {
        return Shine;
    }
}

class Wind
{
    public int Current;
}

class Creature
{
    public CreatureType CreatureType;
    public DeliveryType Delivery; 
    public Creature()
    {
    
    }
    public Creature(CreatureType CT)
    {
        CreatureType = CT;
    }    
}


class Magic 
{
    public DeliveryType CallStork(CreatureType _CR)
    {
        return DeliveryType.Stork;
    }
    public DeliveryType CallDemon(CreatureType _CR)
    {
        return DeliveryType.Demon;
    }
}